package com.suzhe.ymall.order.client;

import com.suzhe.ymall.common.pojo.ApiResEntity;
import com.suzhe.ymall.product.param.LockStockParam;
import com.suzhe.ymall.product.vo.SkuVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collections;
import java.util.List;

@Component
@Slf4j
public class ProductClientFallBack implements ProductClient {

    @Override
    public List<SkuVo> querySkuVosByIds(@RequestParam("ids") List<Integer> ids) {
        log.error("querySkuVosByIds timeout:{}",ids);
        return Collections.EMPTY_LIST;
    }

    @Override
    public  ApiResEntity<String> lockStock(@RequestBody LockStockParam lockStockParam){
        log.error("lockStock timeout:{}",lockStockParam);
        return ApiResEntity.error("创建订单失败");
    }
}
